OPC-UA Embedded Server SDK  2.1.0
Deferred Read Functions

Functions

bool_t UAServer_Is_read_operation_asynchronous (uintptr_t read_context)
 
bool_t UAServer_Is_read_operation_deferrable (uintptr_t read_context)
 
bool_t UAServer_Is_read_operation_deferred (uintptr_t read_context)
 
UA_Status_t UAServer_Defer_read_operation (uintptr_t read_context, uintptr_t *deferral_handle)
 
UA_Status_t UAServer_Read_deferral_complete (uintptr_t deferral_handle, UA_Status_t status_code)
 
void UAServer_Callback_deferred_read_operation_aborted (uintptr_t deferral_handle)
 

Detailed Description

Function Documentation

bool_t UAServer_Is_read_operation_asynchronous ( uintptr_t  read_context)

Is the current read callback invoked due to an asynchronous read request or a monitored item sample?

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
Returns
TRUE if the read is part of an OPC UA Read Service Call.
bool_t UAServer_Is_read_operation_deferrable ( uintptr_t  read_context)

Can the current read operation be deferred if we have to obtain the data value from a slow remote data source?

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
Returns
TRUE if the read operation can be deferred.
bool_t UAServer_Is_read_operation_deferred ( uintptr_t  read_context)

Is the current read operation a repeat of an operation that was previously deferred?

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
Returns
TRUE if the read operation was previously deferred deferred.
UA_Status_t UAServer_Defer_read_operation ( uintptr_t  read_context,
uintptr_t *  deferral_handle 
)

Defer the current read operation as we have to obtain the data from a slow remote data source and doing so synchronously would degrade server response for all connected clients.

This function can only be called from UAServer_Callback_read().

Parameters
[in]read_contextThe read context provided by the SDK.
[out]deferral_handleA unique handle representing this specific deferral.
Returns
OpcUa_Good if the deferral was successful.
UA_Status_t UAServer_Read_deferral_complete ( uintptr_t  deferral_handle,
UA_Status_t  status_code 
)

The read deferral is complete.

The application notifies the SDK that the data has been obtained from the data source and is now available for reading. After making this call the SDK will immediately call UAServer_Callback_read() again. This function must NOT be called from any server callback function.

Parameters
[in]deferral_handleThe deferral handle provided by the SDK.
[out]status_codeThe result of the asynchronous read operation.
Returns
OpcUa_Good if the call was successful.
void UAServer_Callback_deferred_read_operation_aborted ( uintptr_t  deferral_handle)

The deferred read operation is aborted.

The application has previously deferred a read operation and received a deferral handle for the deferred read. This call indicates that the deferral operation has been cancelled by the SDK. This could be due to the client closing the session that the read operation is associated with. After receiving this callback the application must NOT call UAServer_Read_deferral_complete() with this deferral handle as this will result in the SDK dereferencing a free'd pointer.

Parameters
[in]deferral_handleThe deferral handle provided by the SDK.